package com.wbcs.system.component.application.report.configbean.editablereport;

import java.util.HashMap;
import java.util.Map;

import com.wbcs.config.component.application.report.ColBean;
import com.wbcs.util.Consts;

public class EditableReportInsertDataBean extends AbsEditableReportEditDataBean
{

    private Map<String,String> mUpdateConditions;

    public EditableReportInsertDataBean(IEditableReportEditGroupOwnerBean owner)
    {
        super(owner);
    }

    public Map<String,String> getMUpdateConditions()
    {
        return mUpdateConditions;
    }

    public void setMUpdateConditions(Map<String,String> updateConditions)
    {
        mUpdateConditions=updateConditions;
    }

    @Override
	protected void setParamBeanInfoOfColBean(ColBean cbUpdateSrc,EditableReportParamBean paramBean,String configColProperty,String reportTypeKey)
    {
        if(!Consts.COL_DISPLAYTYPE_HIDDEN.equals(cbUpdateSrc.getDisplaytype()))
        {
            EditableReportColBean ercbeanUpdated=(EditableReportColBean)cbUpdateSrc.getExtendConfigDataForReportType(reportTypeKey);
            ercbeanUpdated.setEditableWhenInsert(2);
        }
        if(configColProperty.endsWith("__old")) configColProperty=configColProperty.substring(0,configColProperty.length()-"__old".length());
        paramBean.setParamname(configColProperty);
    }

    @Override
	public void setRealParamnamesInDoPostLoadFinally()
    {
        //提供空实现，因为<insert/>中字段名不可能实现__old结尾，在setParamBeanInfoOfColBean()方法中已经统一去掉了
    }
    
    @Override
	public Object clone(IEditableReportEditGroupOwnerBean newowner)
    {
        EditableReportInsertDataBean newbean=(EditableReportInsertDataBean)super.clone(newowner);
        if(mUpdateConditions!=null)
        {
            newbean.setMUpdateConditions((Map)((HashMap)mUpdateConditions).clone());
        }
        return newbean;
    }
}
